/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import general.util.MyPassDataUtil;
import general.util.SharedPermission;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import jpa.entity.User;

/**
 *
 * @author isaias
 */
@ManagedBean
@RequestScoped
public class SharedPermissionManagedBean implements Serializable{

      private SharedPermission sharedPermission;
    /** Creates a new instance of SharedManagedBean */
    public SharedPermissionManagedBean() {
        sharedPermission = new SharedPermission();
    }

    public boolean hasPermission(String permission) {
        User currentUser = MyPassDataUtil.getInstance().getCurrentUser();
        return sharedPermission.hasPermission(permission, currentUser);
    }

}
